Variational Autoencoders for the Bayesian Neuroengineer

I'm in love with variational autoencoders. This post will be a quick overview of why, what I plan to use them for in my research, and what impact they will likely have in neuroscience, specifically human subject neuroscience and neuroengineering

Introduction

Neuroscience is difficult. The brain is very complex at pretty much every level. That makes precisely controlled scientific experimentation insanely difficult. Most studies are far from controlled in all variables outside of the independent and dependent variables. A major problem arises when those variables are assumed to be fixed.

If it seems like neuroscience hasn't made great progress in explaining the brain's function, it may not be a surprise.

So what does that have to do here? Well, we have some basic models of how the brain may work. When I say model, I mean something we all do: we have expectations of how variables and things interact with each other. That's a model. Almost all models can be translated into a mathematically rigorous form.

How can we build an understanding of the brain?

The traditional approach to science is limited in biological phenomena. For more details, see here

A different way is to constantly explicitly make the model we're entering an experiment with apparent. We all have models of what we're doing. If you do a statistical test, you're using an implicit model. Those are called assumptions, and they must be met for a statistical test to be valid.

However, statistical tests make the models implicit, and it may not be obvious what those models are.

Bayesian approaches seek to make their assumptions explicit and they write their assumptions in the same math as everything else

Variational Bayesian

The problem with Bayesian approaches is that they get very complicated very fast. Complicated in the math sense and in the computational sense; they just take a lot of effort to work through.

In some cases, the "posterior" probabilities that we're very interested in are nigh impossible to compute. One approach, dubbed 'variational' seeks to actually use a much easier to work with posterior that isn't quite as accurate.

Variational in dynamics

Now, I'll play devil's advocate. In dynamical systems, complex bifurcations can happen. What this means is that small deviations in a value can have drastically different effects. For an overview of this take a look here

In variational bayesian approaches, the surrogate posterior may be easier to compute but it may have a very different topological shift with respect to its bifurcation parameter. This could be a major problem. But, as with most things, we'll assume it's not, perform our analysis, and then see how well the model performance was with respect to error.

The beauty of autoencoders in variational space

Now, this is the absolutely beautiful part of the approach.

You have the true posterior distribution. It's encoded in the input vector itself. That vector is sampled from the true posterior. You can then use the autoencoder to encode that vector into the surrogate posterior, the one easier to compute or the one that actually has physiologic basis. You can then decode from here to get an estimate of x, we'll call that $x^*$